package 接口;

public class TestPolymorphism2 {
    public static void main(String[] args) {
        Device[] devices = {
                new Projector("索尼"),
                new Printer2("惠普"),
                new AirConditioner2("格力")
        };
        System.out.println("===设备开机===");
        for (Device d : devices) {
            d.powerOn();
        }
        System.out.println("\n===设备报修===");
        for (Device d : devices) {
            d.repair();
        }
    }
}
